﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ShopOnline.Controls
{
    public partial class BaseRepeater : BaseControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        public event NeedDataSourceEventHandler NeedDataSource;
        private void OnNeedDataSource(EventArgs e)
        {
            if (NeedDataSource != null)
            {
                NeedDataSource(this, e);
            }

            rpt.DataBind();
        }

        public Object DataSource
        {
            get { return rpt.DataSource; }
            set { rpt.DataSource = value; }
        }

        public virtual void Rebind()
        {
            EventArgs e = new EventArgs();
            OnNeedDataSource(e);
        }
    }
}